package com.zhang.apipassenger.service.impl;

import com.zhang.apipassenger.remote.ServiceOrderClient;
import com.zhang.apipassenger.request.OrderRequest;
import com.zhang.apipassenger.service.ServiceOrderService;
import com.zhang.internalcommon.constant.IdentityConstant;
import com.zhang.internalcommon.dto.OrderInfo;
import com.zhang.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类功能描述
 *
 * @author Kye
 * @date 2025-04-16
 */
@Service
public class ServiceOrderServiceImpl implements ServiceOrderService {
	@Autowired
	private ServiceOrderClient serviceOrderClient;

	@Override
	public ResponseResult addOrder(OrderRequest orderRequest) {
		return serviceOrderClient.addOrder(orderRequest);
	}

	@Override
	public ResponseResult cancelOrder(Long orderId) {
		return serviceOrderClient.cancel(orderId, IdentityConstant.PASSENGER_IDENTITY);
	}

	@Override
	public ResponseResult<OrderInfo> detail(Long orderId) {
		return serviceOrderClient.detail(orderId);
	}

	@Override
	public ResponseResult<OrderInfo> currentOrder(String phone, String passengerIdentity) {
		return serviceOrderClient.current(phone,passengerIdentity);
	}
}
